import Vue from 'vue'
import axios from 'axios'
// 导入使用的插件
import Antd from 'ant-design-vue'
import './plugins/Vant'
// import './plugins/Ant'
import 'ant-design-vue/dist/antd.css'
import App from './App.vue'
import router from './router'
import FastClick from 'fastclick'
import './assets/css/border.css'
import './assets/css/reset.css'
import './assets/fonts/fonts/iconfont.css'
import 'lib-flexible/flexible'
import VideoPlayer from 'vue-video-player'
import 'vue-video-player/src/custom-theme.css'
import 'video.js/dist/video-js.css'
Vue.config.productionTip = false
// axios.defaults.baseURL = 'http://114.115.244.242:18999'
Vue.prototype.$http = axios
Vue.use(Antd)
Vue.use(VideoPlayer)
// 解决移动端300ms延迟效果
FastClick.attach(document.body)
// 时间过滤器
Vue.filter('dateFormat', function (originVal) {
  const dt = new Date(originVal)
  const y = dt.getFullYear()
  const m = (dt.getMonth() + 1 + '').padStart(2, '0')
  const d = (dt.getDate() + '').padStart(2, '0')

  const hh = (dt.getHours() + '').padStart(2, '0')
  const mm = (dt.getMinutes() + '').padStart(2, '0')
  const ss = (dt.getSeconds() + '').padStart(2, '0')

  return `${y}/${m}/${d} ${hh}:${mm}:${ss}`
})
// 时间过滤器
Vue.filter('dateFormat1', function (originVal) {
  const dt = new Date(originVal)
  const y = dt.getFullYear()
  const m = (dt.getMonth() + 1 + '').padStart(2, '0')
  const d = (dt.getDate() + '').padStart(2, '0')
  return `${y}/${m}/${d}`
})
// 保留两位小数过滤器
Vue.filter('keepTwoNum', function (val) {
  return val.toFixed(2) + '%'
})
new Vue({
  router,
  render: h => h(App)
}).$mount('#app')
